plat/arm: Mark arm platform initialization functions
authorDaniel Boulby <[email protected]>
Tue, 18 Sep 2018 12:26:03 +0000 (13:26 +0100)
committerAntonio Nino Diaz <[email protected]>
Wed, 3 Oct 2018 10:48:15 +0000 (11:48 +0100)
Mark the initialization functions found in the BL31 boot sequence
as __init so they can be reclaimed when no longer needed.

Change-Id: I687a89346419c7710ef5097feaa325d83c527697
Signed-off-by: Daniel Boulby <[email protected]>
plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
plat/arm/board/fvp/fvp_bl31_setup.c
plat/arm/board/fvp/fvp_common.c
plat/arm/common/arm_bl31_setup.c
plat/arm/common/arm_common.c
plat/arm/common/arm_console.c
plat/arm/common/arm_pm.c
plat/arm/css/drivers/mhu/css_mhu.c
plat/arm/css/drivers/scp/css_pm_scmi.c
plat/arm/css/sgi/sgi_interconnect.c
plat/arm/css/sgm/sgm_interconnect.c

index 5948e149fcd39b29980a2c6394676500b22cd483..b17446c10c92405c889890748b15031734b60a99 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -70,7 +70,7 @@ void fvp_pwrc_write_pcoffr(u_register_t mpidr)
 }
 
 /* Nothing else to do here apart from initializing the lock */
-void plat_arm_pwrc_setup(void)
+void __init plat_arm_pwrc_setup(void)
 {
        arm_lock_init();
 }
index ea1170859efdf41b08c5c8e76bf5f01a9a8b8a17..1c8804f10a47d92368db49ad5e256410c46d8c09 100644 (file)
@@ -10,8 +10,8 @@
 #include <smmu_v3.h>
 #include "fvp_private.h"
 
-void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
-               u_register_t arg2, u_register_t arg3)
+void __init bl31_early_platform_setup2(u_register_t arg0,
+               u_register_t arg1, u_register_t arg2, u_register_t arg3)
 {
        arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
 
index 3f7857eb8f211e4b13ddf8e04c4a2b454ee41e82..aa4f8398de776581d3a2e42e19704a2e3164e785 100644 (file)
@@ -241,7 +241,7 @@ const struct secure_partition_boot_info *plat_get_secure_partition_boot_info(
  * these platforms. This information is stored in a per-BL array to allow the
  * code to take the correct path.Per BL platform configuration.
  ******************************************************************************/
-void fvp_config_setup(void)
+void __init fvp_config_setup(void)
 {
        unsigned int rev, hbi, bld, arch, sys_id;
 
@@ -331,7 +331,7 @@ void fvp_config_setup(void)
 }
 
 
-void fvp_interconnect_init(void)
+void __init fvp_interconnect_init(void)
 {
 #if FVP_INTERCONNECT_DRIVER == FVP_CCN
        if (ccn_get_part0_id(PLAT_ARM_CCN_BASE) != CCN_502_PART0_ID) {
index ce799b0ff1c821c40d1b42a9a75f6afd0d142084..c54566390b7971a4f3d54291acea94819724507c 100644 (file)
@@ -71,7 +71,7 @@ struct entry_point_info *bl31_plat_get_next_image_ep_info(uint32_t type)
  * while creating page tables. BL2 has flushed this information to memory, so
  * we are guaranteed to pick up good data.
  ******************************************************************************/
-void arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config,
+void __init arm_bl31_early_platform_setup(void *from_bl2, uintptr_t soc_fw_config,
                                uintptr_t hw_config, void *plat_params_from_bl2)
 {
        /* Initialize the console to provide early debug support */
@@ -235,7 +235,7 @@ void arm_bl31_plat_runtime_setup(void)
        arm_console_runtime_init();
 }
 
-void bl31_platform_setup(void)
+void __init bl31_platform_setup(void)
 {
        arm_bl31_platform_setup();
 }
@@ -251,7 +251,7 @@ void bl31_plat_runtime_setup(void)
  * architectural setup (bl31_arch_setup()) does not do anything platform
  * specific.
  ******************************************************************************/
-void arm_bl31_plat_arch_setup(void)
+void __init arm_bl31_plat_arch_setup(void)
 {
        const mmap_region_t bl_regions[] = {
                MAP_BL31_TOTAL,
@@ -273,7 +273,7 @@ void arm_bl31_plat_arch_setup(void)
        arm_setup_romlib();
 }
 
-void bl31_plat_arch_setup(void)
+void __init bl31_plat_arch_setup(void)
 {
        arm_bl31_plat_arch_setup();
 }
index 28ff5d9b91dae86a4adca504a66fa049ece1e5c2..ae06ef280a77758fff991460323c80c9fff856f7 100644 (file)
@@ -41,7 +41,7 @@ void arm_setup_romlib(void)
  * - Coherent memory region, if applicable.
  */
 
-void arm_setup_page_tables(const mmap_region_t bl_regions[],
+void __init arm_setup_page_tables(const mmap_region_t bl_regions[],
                           const mmap_region_t plat_regions[])
 {
 #if LOG_LEVEL >= LOG_LEVEL_VERBOSE
index 6c8587fc4406370a7909ba11fb78f8e564df31fe..bd3dca17f60a6154acf76c6b4aaed35be96925aa 100644 (file)
@@ -19,7 +19,7 @@ static console_pl011_t arm_runtime_console;
 #endif
 
 /* Initialize the console to provide early debug support */
-void arm_console_boot_init(void)
+void __init arm_console_boot_init(void)
 {
 #if MULTI_CONSOLE_API
        int rc = console_pl011_register(PLAT_ARM_BOOT_UART_BASE,
index bf548c10c9a26902ac7de12fd9e8afd9cd115fab..85efc7dd2e7021a2845676a5624ca89c4a1152f0 100644 (file)
@@ -208,7 +208,7 @@ void plat_arm_program_trusted_mailbox(uintptr_t address)
  * The ARM Standard platform definition of platform porting API
  * `plat_setup_psci_ops`.
  ******************************************************************************/
-int plat_setup_psci_ops(uintptr_t sec_entrypoint,
+int __init plat_setup_psci_ops(uintptr_t sec_entrypoint,
                                const plat_psci_ops_t **psci_ops)
 {
        *psci_ops = plat_arm_psci_override_pm_ops(&plat_arm_psci_pm_ops);
index 30492a69546fec9faad73b0f84df435a08d4c6be..7b33317566eeb1fdaf9a868ec6b2a4837be14825 100644 (file)
@@ -81,7 +81,7 @@ void mhu_secure_message_end(unsigned int slot_id)
        arm_lock_release();
 }
 
-void mhu_secure_init(void)
+void __init mhu_secure_init(void)
 {
        arm_lock_init();
 
@@ -93,7 +93,7 @@ void mhu_secure_init(void)
        assert(mmio_read_32(PLAT_CSS_MHU_BASE + CPU_INTR_S_STAT) == 0);
 }
 
-void plat_arm_pwrc_setup(void)
+void __init plat_arm_pwrc_setup(void)
 {
        mhu_secure_init();
 }
index 258c1c29ca435d0152e3d12c7762a61b84761f4f..d280101d6ec651da08d757e70a215ec327334730 100644 (file)
@@ -328,7 +328,7 @@ static int scmi_ap_core_init(scmi_channel_t *ch)
        return 0;
 }
 
-void plat_arm_pwrc_setup(void)
+void __init plat_arm_pwrc_setup(void)
 {
        channel.info = &plat_css_scmi_plat_info;
        channel.lock = ARM_LOCK_GET_INSTANCE;
index f4e7676a4f5eb6f0dd11ad459b5246e0e6c5186a..325b5b1523e5ce8496fd6a1ec44cfaa30e164aa2 100644 (file)
@@ -17,7 +17,7 @@
 /******************************************************************************
  * Helper function to initialize ARM interconnect driver.
  *****************************************************************************/
-void plat_arm_interconnect_init(void)
+void __init plat_arm_interconnect_init(void)
 {
 }
 
index 301ea84f0bd6fcf0ef98fc47c640330830cc3b62..5b45341b9737a4730c6f7d643f3a66434abbd13c 100644 (file)
@@ -4,6 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <cdefs.h>
+
 /*
  * As the SGM platform supports FCM (with automatic interconnect
  * enter/exit), we should not do anything in these interface functions.
@@ -13,7 +15,7 @@
 /******************************************************************************
  * Helper function to initialize ARM interconnect driver.
  *****************************************************************************/
-void plat_arm_interconnect_init(void)
+void __init plat_arm_interconnect_init(void)
 {
 }